package com.ray.controller;

import com.ray.pojo.User;
import com.ray.service.UserServiceImpl;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.util.List;

public class UserController
{
    public void getUserList()
    {
        ClassPathXmlApplicationContext cpx = new ClassPathXmlApplicationContext("applicationContext.xml");
        UserServiceImpl userServiceImpl = cpx.getBean("userService", UserServiceImpl.class);
        List<User> userList = userServiceImpl.getUserList();
        for (User user : userList)
        {
            System.out.println(user.toString());
        }
    }
}
